<!DOCTYPE html>
<html lang="zh-CN" ng-app='app'>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.6/angular.js"></script>
</head>
<body ng-controller="myController">
    <ul>
        <li ng-repeat="item in arr">
            <button ng-click="a = 200;">按钮 {{item}} </button>
            <p>a的值是： {{a}} </p>
        </li>
    </ul>
    a的值是: {{a}}
    <button ng-click="index = 100;">点击给index赋值</button>
    index的值是:{{index}}
    <script>
        angular.module('app', []).controller('myController', function($scope) {
            $scope.arr = [1, 2, 3];
            $scope.a = 0;

        });
    </script>
</body>
</html>